package jmine.tec.aom.domain;

import java.util.Set;

/**
 * Common interface for classes that hold a collection of {@link AbstractPropertyValue} for some collection of {@link Property}.
 * 
 * @author jrenaut
 */
public interface Propertized extends PropertyProvider {

    /**
     * @return the {@link Set} of {@link Property} for which actual {@link AbstractPropertyValue} were defined
     */
    Set<Property> getRealProperties();

    /**
     * @return the {@link Set} of {@link Property} for which values were defined through the use of
     * {@link jmine.tec.aom.annotation.SyntheticProperty}
     */
    Set<Property> getSyntheticProperties();

    /**
     * @return the {@link Set} of defined {@link AbstractPropertyValue}
     */
    Set<AbstractPropertyValue<?>> getPropertyValues();

    /**
     * @return the parent {@link Propertized} if any
     */
    Propertized getParent();

    /**
     * @param property a {@link Property}
     * @return the {@link AbstractPropertyValue} for the given {@link Property} if it's been defined
     */
    AbstractPropertyValue getPropertyValue(Property property);

    /**
     * @param propertyValue an {@link AbstractPropertyValue} to be removed
     */
    void removePropertyValue(AbstractPropertyValue propertyValue);

    /**
     * @param propertyValue an {@link AbstractPropertyValue} to be added
     */
    void addPropertyValue(AbstractPropertyValue propertyValue);

}
